package com.ebor.utils.utils;

import lombok.extern.slf4j.Slf4j;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @author C
 */
@Slf4j
public class IpUtils {

    public static String getLocalIp() {
        InetAddress ia;
        try {
            ia = InetAddress.getLocalHost();
            return ia.getHostAddress();
        } catch (UnknownHostException e) {
            log.error("ip获取出错", e);
        }
        return "";
    }
}
